#ifndef _MYSQL_H
#define _MYSQL_H
#include<iostream>
#include<mysql_connection.h>
#include<mysql_driver.h>
#include <cppconn/driver.h>
#include <cppconn/exception.h>
#include <cppconn/resultset.h>
#include <cppconn/statement.h>
#include<vector>
using std::vector;
using namespace sql;
using std::string;
using std::cin;
using std::cout;
using std::endl;
class Mysql_Custom
{
public:
Mysql_Custom(string DBhost,string User,string Password);
bool Write_Operation(string SQL_string);
Mysql_Custom(const Mysql_Custom&)=delete;
~Mysql_Custom()
{
    if(this->_res!=nullptr)
    {
        delete this->_res;
        this->_res=nullptr;
    }
    if(this->_stmt!=nullptr)
    {
        delete this->_stmt;
        this->_stmt=nullptr;
    }
    if(this->_conn!=nullptr)
    {
        delete this->_conn; 
        this->_conn=nullptr;
    }
     
}
ResultSet* _res;
Statement* _stmt;
private:
Driver *_dirver;
Connection* _conn;


};
struct webpage
{
    int Article_id;
    string Article_title;
    string Article_link;
    string Article_describe;
};
struct wordWeight
{
     int word_id;
     int Article_id;
     double Weight;
};
struct chinese_english_dictionary
{
    int word_id;
    string word;
    int Frequency;
};
struct letter_Index
{
    int letter_id;
    string letter;
    int word_id;
};
#endif